//
//  textVC.m
//  Notification
//
//  Created by Apple on 2017/3/15.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "textVC.h"
#import "HongFile.pch"
@interface textVC ()<UITextFieldDelegate,UITextViewDelegate>

@end

@implementation textVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"TextVC";
    self.view.backgroundColor = [UIColor whiteColor];
    self.texf = [[UITextField alloc]initWithFrame:CGRectMake(30, 100, SCREEN_WIDTH-60, 40)];
    self.texf.placeholder = @"请输入您想输入的内容";
    self.texf.font = [UIFont systemFontOfSize:15];
    self.texf.borderStyle = UITextBorderStyleLine;
    self.texf.delegate = self;
#pragma mark-编辑时出现删除
    self.texf.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self.view addSubview:self.texf];
    
    self.tv = [[UITextView alloc]initWithFrame:CGRectMake(30, 160, SCREEN_WIDTH-60, SCREEN_HEIGHT-200)];
    self.tv.textColor = [UIColor blackColor];
    self.tv.font = [UIFont systemFontOfSize:15];
#pragma mark-设置委托方法
    self.tv.delegate = self;

    self.tv.text = @"    其实对于iOS开发，我们的日常开发上已经用到了这样一个静态分析的工具，那就是 Clang， Clang 是支持C、C++、Objective-C 和 Swift 的一个前端编译工具，他将 OC 或者 Swift 的代码输出抽象语法树(Abstract Syntax Tree)，然后编译成 LLVM 的 bitcode，最后由 LLVM 编译成 machine code。这个工具支撑着我们日常的开发和调试。         OCLint 就是一个建立在 Clang 上的工具,能够发现代码中潜在的问题。具体的功能请见官方文档，这里主要介绍的是其安装与使用。";
#pragma mark-是否可以拖动
    self.tv.scrollEnabled = YES;
#pragma mark-是否可以编辑
    self.tv.editable = NO;
#pragma mark-自定义高度
    self.tv.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:self.tv];
}
//-(void)turnover{
//    NSDictionary * dic= [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"2", nil];
//    NSNotification*not = [NSNotification notificationWithName:@"go" object:self.texf.text userInfo:dic];
//    [[NSNotificationCenter defaultCenter]postNotification:not];
//    [self.navigationController popViewControllerAnimated:YES];
//}
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

-(void)dealloc{
    [[NSNotificationCenter defaultCenter]removeObserver:self name:@"go" object:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
